/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2024-06-19
 * Time: 20:37
 */
//懒汉模式
class SinlgetonLazy {
    private static SinlgetonLazy instance = null;
    public static SinlgetonLazy getInstance() {
        if(instance == null) {
            instance = new SinlgetonLazy();
        }
        return instance;
    }
    private SinlgetonLazy() {

    }
}
public class Deom23 {
    public static void main(String[] args) {
        SinlgetonLazy s1 = SinlgetonLazy.getInstance();
        SinlgetonLazy s2 = SinlgetonLazy.getInstance();
        System.out.println(s1 == s2);
    }
}
